PluginProbe
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor / 2.0.2
User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor v2.0.2
4.0.2 4.0.1 4.0.0 3.16.6 3.16.5 3.16.4 3.16.3 3.16.2 3.16.1 3.16.0 3.15.9 3.9.9 3.9.5 3.9.6 3.9.7 3.9.8 1.1.7 1.1.8 1.1.9 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 All 340 releases
profile-builder / assets / lib / wck-api / fields / user select.php

user select.php in User Profile Builder – Beautiful User Registration Forms, User Profiles & User Role Editor 2.0.2, at assets/lib/wck-api/fields/user select.php

21 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /* @param string $meta Meta name.
3 * @param array $details Contains the details for the field.
4 * @param string $value Contains input value;
5 * @param string $context Context where the function is used. Depending on it some actions are preformed.;
6 * @return string $element input element html string. */
7
8 $args = apply_filters( 'wck-user-select-args', array( 'orderby' => 'display_name' ) );
9 $user_query = new WP_User_Query($args);
10 if( !empty( $user_query->results ) ){
11 $element .= '<select name="'. esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" id="';
12 if( !empty( $frontend_prefix ) )
13 $element .= $frontend_prefix;
14 $element .= esc_attr( Wordpress_Creation_Kit_PB::wck_generate_slug( $details['title'], $details ) ) .'" class="mb-user-select mb-field" >';
15 $element .= '<option value="">'. __('...Chose', 'wck') .'</option>';
16 foreach( $user_query->results as $user ){
17 $element .= '<option value="'. esc_attr( $user->ID ) .'" '. selected( $user->ID, $value, false ) .' >'. esc_html( $user->display_name ) .'</option>';
18 }
19 $element .= '</select>';
20 }
21 ?>